/**
 *  TextMash - simple IDE for Clojure
 *  
 *  Copyright (C) 2010 Aleksander Naszko
 *
 *  This program is free software: you can redistribute it and/or modify
 *  it under the terms of the GNU General Public License as published by
 *  the Free Software Foundation, either version 3 of the License, or
 *  (at your option) any later version.
 *
 *  This program is distributed in the hope that it will be useful,
 *  but WITHOUT ANY WARRANTY; without even the implied warranty of
 *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 *  GNU General Public License for more details.
 *  
 *  You should have received a copy of the GNU General Public License
 *  along with this program.  If not, see <http://www.gnu.org/licenses/>.
 */
package pl.olek.textmash;

import java.awt.Font;
import java.awt.event.KeyEvent;
import java.net.URL;

import javax.swing.KeyStroke;
import javax.swing.UIManager;

import pl.olek.textmash.menu.MenuBuilder;

/**
 * 
 * @author anaszko
 *
 */
public class UnixSupport extends Support {
	Font font = new Font("Monospaced", Font.PLAIN, 12);

	public UnixSupport() {
		try {

			UIManager.setLookAndFeel(UIManager.getSystemLookAndFeelClassName());
		} catch (Exception e) {
			throw new RuntimeException(e);
		}
	}

	@Override
	public Font getFont() {
		return font;
	}

	@Override
	public int positionDialogButton(int amount, int index) {
		return index;
	}
	@Override
	public KeyStroke getRedoKey() {
		return MenuBuilder.getStdKeyStroke(KeyEvent.VK_Y, MenuBuilder.NONE);
	}

	@Override
	public String getTitle(String name) {
		return String.format("%s - TextMash", name);
	}

//	@Override
//	public void decorateWindow(JFrame frame, File file) {
//		
//	}
//
//	@Override
//	public void setModified(JFrame frame, boolean value) {
//		
//	}

	@Override
	public URL getResource(String name) {
		return Support.class.getClassLoader(
				).getResource(name);
	}
	
	@Override
	public String getId() {
		return "unix";
	}

	@Override
	public String getUsername() {
		return System.getenv("USER");
	}	
}
